package com.wangjiyuan.shiwupai.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.wangjiyuan.shiwupai.mine.config.MyConfig;

import java.util.List;

/**
 * Created by ZangSyeriong on 2016/11/28.
 */

public class MyOrderViewPagerAdapter extends FragmentPagerAdapter{

    private List<Fragment> fragmentList;

    public MyOrderViewPagerAdapter(FragmentManager fm, List<Fragment> fragmentList) {
        super(fm);
        this.fragmentList = fragmentList;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return MyConfig.TAB_ORDER_NAME[position];
    }
}
